<?php
/**
 * Created by PhpStorm.
 * User: qdq
 * Date: 2017/3/9
 * Time: 19:04
 */

namespace app_supplier\models;


class DealerPayAccount extends Common
{
    public static function getFlowsAllPayAccount($dealer_id = '')
    {
        $result = static::findAll(['status'=>1,'dealer_id'=>$dealer_id]);
        $storePayAccountData = array("bank" => array(), "wechat" => array(), "alipay" => array());
        foreach ($result as $account) {
            if ($account['type'] == 'bank') {
                $storePayAccountData['bank'][] = $account;
            }
            if ($account['type'] == 'wechat') {
                $storePayAccountData['wechat'][] = $account;
            }
            if ($account['type'] == 'alipay') {
                $storePayAccountData['alipay'][] = $account;
            }
        }
        return $storePayAccountData;
    }
}